﻿<%@ Page Language="C#" AutoEventWireup="true" masterpagefile="~/Admin/Main.master" title="链接列表"  CodeFile="FriendLinkList.aspx.cs" Inherits="Admin_FriendLinkList" %>

<%@ Register TagPrefix="uc" TagName="ContentMenu" Src="~/Admin/ContentMenu.ascx"%>
<asp:Content ID="Content1" ContentPlaceHolderID="LeftMenu" Runat="Server">
    <uc:ContentMenu ID="ContentMenu" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MidContent" Runat="Server">
  <div id="mainMenu">
  	<ul>
		<li><a href="FriendLinkAdd.aspx">添加链接</a></li><li><a href="FriendLinkList.aspx">链接列表</a></li><li><a href="FriendLinkEdit.aspx">编辑链接</a></li></ul>
  </div>
   <div id="main">
   <asp:Label id="Msg" runat="server" Text="" CssClass="msg" Visible="False"></asp:Label>
   <asp:GridView ID="FriendLinkList" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnPageIndexChanging="FriendLinkList_PageIndexChanging" DataKeyNames="FriendLinkId" OnRowCancelingEdit="FriendLinkList_RowCancelingEdit" OnRowEditing="FriendLinkList_RowEditing" OnRowUpdating="FriendLinkList_RowUpdating" PageSize="11" OnRowDeleting="FriendLinkList_RowDeleting" CellPadding="0" CssClass="gv" Width="100%" EmptyDataText="暂无任何友情链接" OnRowDataBound="FriendLinkList_RowDataBound" >
        <Columns>
            <asp:BoundField DataField="FriendLinkId" HeaderText="ID" >
                <ControlStyle CssClass="gvOrderId" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="链接类型">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("Type").ToString()=="True"?"图片链接":"文字链接" %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:HyperLinkField DataNavigateUrlFields="url" DataTextField="url" HeaderText="链接地址"
                Target="_blank" />
            <asp:BoundField DataField="Title" HeaderText="链接文字" ReadOnly="True" SortExpression="Title" NullDisplayText="无" />
            <asp:TemplateField HeaderText="Logo图片">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Bind("LogoPath") %>'
                        Target="_blank" Text='<%# Eval("LogoPath").ToString()==""?"无":"预览" %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                <EditItemTemplate>
                    <asp:Button ID="UpdateBt" runat="server" CausesValidation="True" CommandName="Update"
                        Text="更新" />
                    <asp:Button ID="CancelBt" runat="server" CausesValidation="False" CommandName="Cancel"
                        Text="取消" />    
                </EditItemTemplate>
                <ItemStyle CssClass="gvCommandField" />
                <ItemTemplate>
                    &nbsp;<asp:Button ID="DelBt" runat="server" CausesValidation="False" CommandName="Delete" Text="删除" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="编辑链接">
                <ItemStyle CssClass="gvBtAField" />
                <ItemTemplate>
                    <asp:HyperLink ID="EditHyperLink" runat="server" NavigateUrl='<%# Eval("FriendLinkId", "FriendLinkEdit.aspx?FriendLinkId={0}") %>'
                        Text="编辑链接"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle CssClass="gvRow" />
        <EditRowStyle CssClass="gvEditRow" />
        <PagerStyle CssClass="gvPage" />
        <HeaderStyle CssClass="gvHeader" />
        <AlternatingRowStyle CssClass="gvAlternatingRow" />
    </asp:GridView>

  </div>
  <script language="JavaScript" type="text/javascript" >
        topMenuThisPage(2);//当前位置顶部菜单标识
        leftMenuThisPage(2,4);//当前位置左侧菜单标识
        mainMenuThisPage(2);//当前选项卡标识
  </script>
</asp:Content>
